using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ShipExplorer : Panel
{
    public ShipExplorerList m_ExplorerList;
    public ShipsDesigner m_ShipDesigner;

    private void Awake()
    {
        m_ExplorerList.m_OnShipSelectedCallback = OnShipBeOpendByBlueprint;
    }
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    public override void Hide()
    {
        gameObject.SetActive(false);
    }
    public override void Show()
    {
        gameObject.SetActive(true);
        m_ExplorerList.Init();
    }
    public void OnShipBeOpendByBlueprint(Ship ship)
    {
        m_ShipDesigner.Init(ship);
        Hide();
        m_ShipDesigner.Show();
        m_ShipDesigner.m_PreviousPanel = this;
    }

    public void OnCreateNewClicked()
    {
        m_ShipDesigner.Init(null);
        Hide();
        m_ShipDesigner.Show();
        m_ShipDesigner.m_PreviousPanel = this;
    }
}
